﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mscook.core.domain;
using NHibernate.Linq;

namespace mscook.core.repositories
{
    public class CommentRepository:Repository<Comment>, mscook.core.repositories.ICommentRepository
    {
        public IList<Comment> GetByResourceIdByLimit(string resourceId,int start,int limit)
        {
            var query = (from x in this.Session.Query<Comment>() select x)
                .Where(o => o.ResourceId == resourceId)
                .OrderBy(o=>o.CreateTime)
                ;
            return query.Skip(start).Take(limit).ToList();
        }


    }
}
